<template>
  <div class="bcg">
    <header-comm></header-comm>
    <a-spin :spinning="spinning">
      <div class="shjj_box shjj_box1">
        <div class="shjj_form shjj_form1">
          <ul>
            <li>
              <span class="inp_tit">进件客户：</span>

              <a-select
                showSearch
                allowClear
                placeholder="请选择进件客户"
                optionFilterProp="children"
                style="width: 300px"
                @search="khmcSearch"
                @change="jjkhChange"
                @focus="handleFocus"
                @blur="handleBlur"
                :filterOption="false"
                :disabled="editflag"
                notFoundContent="未找到您搜索的内容"
                :defaultValue="jjkh_value"
              >
                <a-select-option
                  v-for="(item,i) in jjkhlist"
                  :key="i"
                  :value="item.GSMC"
                  :data-sqdwid="item.SQDWID"
                  @click="getsqdwid(item.SQDWID)"
                >{{item.GSMC}}</a-select-option>
              </a-select>
            </li>
            <li>
              <span class="inp_tit">业务申请编号：</span>
              <a-input
                placeholder="请输入业务申请编号"
                :disabled="editfl=='ok'?false:true"
                v-model="out_request_no"
              />
              <div class="bz_box ztlx_box">
                <p></p>
                <p class="zs_tit">#注：审核中资料更换，需要重新走进件流程，请修改业务申请编号。在原编号后加_1</p>
              </div>
            </li>
            <li>
              <div class="gth">
                <span class="inp_tit">主体类型：</span>
                <a-radio-group @change="onChange" v-model="organization_type">
                  <a-radio :style="radioStyle" :value="2">企业</a-radio>
                  <a-radio :style="radioStyle" :value="4">个体工商户</a-radio>
                </a-radio-group>
              </div>
              <div class="bz_box ztlx_box">
                <p class="zs_tit">#个体工商户，营业执照上的主体类型一般为个体户、个体工商户、个体经营。</p>
                <p class="zs_tit">#企业，营业执照上的主体类型一般为有限公司、有限责任公司。</p>
              </div>
            </li>
            <li>
              <p class="upload_tit">请上传营业执照/登记证书信息</p>
              <div class="bz_box yyzz_box">
                <div class="yq_tit">
                  <p>#图片要求：</p>
                  <p>（1）请上传证件的彩色扫描件或彩色数码拍摄件，黑白复印件需加盖公章（公章信息需完整） 。</p>
                  <p>（2）不得添加无关水印（非微信支付商户申请用途的其他水印）。</p>
                  <p>（3）需提供证件的正面拍摄件，完整、照面信息清晰可见。信息不清晰、扭曲、压缩变形、反光、不完整均不接受。</p>
                  <p>（4）不接受二次剪裁、翻拍、PS的证件照片。</p>
                </div>
                <div class="yq_tit">
                  <p>#商户名称要求 ：</p>
                  <p>（1）请填写营业执照的商家名称，2~110个字符，支持括号 。</p>
                  <p>（2）个体工商户不能以“公司”结尾。</p>
                  <p>（3）个体工商户，若营业执照上商户名称为空或为“无”，请填写"个体户+经营者姓名"，如“个体户张三” 。</p>
                </div>
              </div>
              <div class="up_pic">
                <span class="inp_tit">证件扫描件：</span>
                <div class="clearfix">
                  <a-upload
                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                    listType="picture-card"
                    :fileList="zjsmfileList"
                    @preview="handlePreview"
                    @change="zjsmChange"
                    accept=".jpg"
                  >
                    <div v-if="zjsmfileList.length < 1">
                      <a-icon type="plus" />
                      <div class="ant-upload-text">照片上传</div>
                    </div>
                  </a-upload>
                </div>
              </div>
            </li>

            <li>
              <span class="inp_tit">证件注册号：</span>
              <a-input placeholder="请输入证件注册号" v-model="business_license_number" />
            </li>
            <li>
              <span class="inp_tit">商户名称：</span>
              <a-input placeholder="请输入商户名称" v-model="merchant_name" />
            </li>
            <li>
              <span class="inp_tit">经营者/法定代表人姓名：</span>
              <a-input placeholder="请输入经营者/法定代表人姓名" v-model="legal_person" />
            </li>
          </ul>
        </div>
        <div v-if="organization_type==2" class="shjj_form shjj_form1">
          <ul>
            <li>
              <p class="upload_tit">
                组织机构代码证信息：
                <span class="red_tit">#主体为企业/党政、机关及事业单位/其他组织，且证件号码不是18位时必填：</span>
              </p>
              <div class="bz_box yyzz_box">
                <div class="yq_tit">
                  <p></p>
                  <p>（1）请填写组织机构代码证上的组织机构代码。</p>
                  <p>（2）请填写组织机构代码证上的组织机构代码。 示例值：12345679-A</p>
                  <p>（3）请填写组织机构代码证的有效期限，注意参照示例中的格式。</p>
                  <p>（4）若证件有效期为长期，请填写：长期</p>
                  <p>（5）结束时间需大于开始时间</p>
                  <p>（6）有效期必须大于60天，即结束时间距当前时间需超过60天。2014-01-01</p>
                </div>
              </div>
              <div>
                <span class="inp_tit">经营者/法人证件类型：</span>
                <!-- <a-input placeholder="请输入法人证件类型：" v-model="organization_number" /> -->
                <a-select :default-value="id_doc_type" style="width: 300px" @change="zjChange">
                  <a-select-option value="IDENTIFICATION_TYPE_MAINLAND_IDCARD">中国大陆居民-身份证</a-select-option>
                  <a-select-option value="IDENTIFICATION_TYPE_OVERSEA_PASSPORT">其他国家或地区居民-护照</a-select-option>
                  <a-select-option value="IDENTIFICATION_TYPE_HONGKONG">中国香港居民–来往内地通行证</a-select-option>
                  <a-select-option value="IDENTIFICATION_TYPE_MACAO">中国澳门居民–来往内地通行证</a-select-option>
                  <a-select-option value="IDENTIFICATION_TYPE_TAIWAN">中国台湾居民–来往大陆通行证</a-select-option>
                </a-select>
              </div>
            </li>
            <li>
              <div class="up_pic">
                <span class="inp_tit">组织机构代码证照片：</span>
                <div class="clearfix">
                  <a-upload
                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                    listType="picture-card"
                    :fileList="zzjgfileList"
                    @preview="handlePreview"
                    @change="zzjgChange"
                    accept=".jpg"
                  >
                    <div v-if="zzjgfileList.length < 1">
                      <a-icon type="plus" />
                      <div class="ant-upload-text">照片上传</div>
                    </div>
                  </a-upload>
                </div>
              </div>
            </li>
            <li>
              <span class="inp_tit">组织机构代码：</span>
              <a-input placeholder="请输入组织机构代码" v-model="organization_number" />
            </li>
            <li>
              <span class="inp_tit">组织机构代码有效期：</span>
              <a-input placeholder="请输入组织机构代码有效期" v-model="organization_time" />
            </li>
          </ul>
        </div>
        <div class="shjj_form shjj_form2">
          <!-- 经营者/法人身份证信息--开始 -->
          <ul v-if="id_doc_type=='IDENTIFICATION_TYPE_MAINLAND_IDCARD'?true:false">
            <li>
              <p class="upload_tit">经营者/法人身份证信息</p>
              <div class="up_pic">
                <span class="inp_tit">身份证人像面照片上传：</span>
                <div class="clearfix">
                  <a-upload
                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                    listType="picture-card"
                    :fileList="sfzfileList"
                    @preview="handlePreview"
                    @change="sfzChange"
                    accept=".jpg"
                  >
                    <div v-if="sfzfileList.length < 1">
                      <a-icon type="plus" />
                      <div class="ant-upload-text">照片上传</div>
                    </div>
                  </a-upload>
                </div>
              </div>
            </li>
            <li>
              <div class="up_pic">
                <span class="inp_tit">身份证国徽面照片上传：</span>
                <div class="clearfix">
                  <a-upload
                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                    listType="picture-card"
                    :fileList="sfzghfileList"
                    @preview="handlePreview"
                    @change="sfzghChange"
                    accept=".jpg"
                  >
                    <div v-if="sfzghfileList.length < 1">
                      <a-icon type="plus" />
                      <div class="ant-upload-text">照片上传</div>
                    </div>
                  </a-upload>
                </div>
              </div>
            </li>
            <li>
              <span class="inp_tit">身份证姓名：</span>
              <a-input placeholder="请输入身份证姓名" v-model="id_card_name" />
            </li>
            <li>
              <span class="inp_tit">身份证号码：</span>
              <a-input placeholder="请输入身份证号码" v-model="id_card_number" />
            </li>
            <li>
              <span class="inp_tit">身份证有效期限：</span>
              <a-input placeholder="请输入身份证有效期限" v-model="id_card_valid_time" />
              <div>
                <div class="bz_box yq_tit">
                  <p>#身份证要求：</p>
                  <p>（1）请填写身份证有效期的结束时间，注意参照示例中的格式。</p>
                  <p>（2）若证件有效期为长期，请填写：长期。</p>
                  <p>（3）证件有效期需大于60天。</p>
                  <p>示例值：2026-06-06，长期</p>
                </div>
              </div>
            </li>
          </ul>
          <!-- 经营者/法人身份证信息--结束 -->
          <!-- 选择护照是--显示--开始 -->
          <ul v-if="id_doc_type!='IDENTIFICATION_TYPE_MAINLAND_IDCARD'?true:false">
            <li>
              <p class="upload_tit">经营者/法人其他类型证件信息</p>

              <span class="inp_tit">证件姓名：</span>
              <a-input placeholder="请输入证件姓名" v-model="id_doc_name" />
            </li>
            <li>
              <span class="inp_tit">证件号码：</span>
              <a-input placeholder="请输入证件号码" v-model="id_doc_number" />
            </li>
            <li>
              <div class="up_pic">
                <span class="inp_tit">证件照片：</span>
                <div class="clearfix">
                  <a-upload
                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                    listType="picture-card"
                    :fileList="hzfileList"
                    @preview="handlePreview"
                    @change="hzChange"
                    accept=".jpg"
                  >
                    <div v-if="hzfileList.length < 1">
                      <a-icon type="plus" />
                      <div class="ant-upload-text">照片上传</div>
                    </div>
                  </a-upload>
                </div>
              </div>
            </li>
            <li>
              <span class="inp_tit">证件结束日期：</span>
              <a-date-picker
                @change="enddateChange"
                :placeholder="doc_period_end!=''?doc_period_end:'请输入证件结束日期'"
              />
              <!-- <a-input placeholder="请输入证件结束日期" v-model="id_card_name" /> -->
            </li>
          </ul>
          <!-- 选择护照是--显示--结束 -->

          <!-- 结算账户信息--开始 -->
          <ul>
            <li>
              <div class="bz_box">
               
                <div class="khyh">
                  <p>
                    <a href="https://vip.bearing.cn/excelfile/开户银行全称（含支行）对照表.xlsx">#开户银行全称（含支行）对照表</a>
                  </p>
                  <p>
                    1、
                    <a href="https://vip.bearing.cn/excelfile/十七家银行.xls">17家直连银行</a>无需填写，如为其他银行，开户银行全称（含支行）和开户银行联行号二选一。
                  </p>
                  <p>2、需填写银行全称，如"深圳农村商业银行XXX支行"</p>
                </div>
              </div>
              <p class="upload_tit">结算账户信息</p>
              <span class="inp_tit">开户银行：</span>
              <!-- <a-input placeholder="请输入开户银行" v-model="account_bank" /> -->
              <a-auto-complete
                v-model="account_bank"
                :data-source="dataSource"
                style="width: 200px"
                placeholder="请输入开户银行"
                @change="getkhyh"
                :filter-option="filterOption"
              />
            </li>
            <li>
              <span class="inp_tit">开户名称：</span>
              <a-input placeholder="请输入开户名称" v-model="account_name" />
            </li>
            <li>
               <div class="bz_box">
                <p>
                  <a href="https://vip.bearing.cn/excelfile/省市区编号对照表.xlsx">#省市区编号对照表</a>
                </p>
              
              </div>
              <span class="inp_tit">开户银行省市编码：</span>
              <a-input placeholder="请输入开户银行省市编码" v-model="bank_address_code" />
            </li>
            <li>
              <span class="inp_tit">银行帐号：</span>
              <a-input placeholder="请输入银行帐号" v-model="account_number" />
            </li>
            <li>
              <span class="inp_tit">开户银行全称（含支行)：</span>
              <a-input placeholder="请输入开户银行全称" v-model="bank_name" />
            </li>
          </ul>
          <!-- 结算账户信息--结束 -->
        </div>
        <div class="shjj_form shjj_form3">
          <ul>
            <li>
              <p class="upload_tit">超级级管理员信息</p>
              <div class="bz_box cjgly yq_tit">
                <p>1、若管理员类型为法人，则该身份证号码需与法人身份证号码一致。若管理员类型为经办人，则可填写实际经办人的身份证号码。</p>
                <p>2、可传身份证、来往内地通行证、来往大陆通行证、护照等证件号码。</p>
                <p>3、超级管理员签约时，校验微信号绑定的银行卡实名信息，是否与该证件号码一致。</p>
              </div>
              <span class="inp_tit">超级管理员类型：</span>
              <a-radio-group @change="onChange" v-model="contact_type">
                <a-radio :style="radioStyle" :value="65">法人/经营者</a-radio>
                <a-radio :style="radioStyle" :value="66">负责人</a-radio>
              </a-radio-group>
            </li>
            <li>
              <span class="inp_tit">超级管理员姓名：</span>
              <a-input placeholder="请输入超级管理员姓名" v-model="contact_name" />
            </li>
            <li>
              <span class="inp_tit">超级管理员身份证件号码：</span>
              <a-input placeholder="请输入超级管理员身份证件号码" v-model="contact_id_card_number" />
            </li>
            <li>
              <span class="inp_tit">超级管理员手机：</span>
              <a-input placeholder="请输入超级管理员手机" v-model="mobile_phone" />
            </li>
            <li>
              <span class="inp_tit">超级管理员邮箱：</span>
              <a-input placeholder="请输入超级管理员邮箱" v-model="mobile_email" />
            </li>
          </ul>
        </div>
        <div class="shjj_form shjj_form4">
          <ul>
            <li>
              <p class="upload_tit">店铺信息</p>
              <div class="bz_box dpxx yq_tit">
                <p>#即最多16个汉字长度。将在支付完成页向买家展示，需与商家的实际售卖商品相符 。</p>
              </div>
              <span class="inp_tit">商户简称：</span>
              <a-input placeholder="请输入商户名称" v-model="merchant_shortname" />
            </li>
            <li>
              <div class="up_pic">
                <span class="inp_tit">店铺二维码：</span>
                <div class="clearfix">
                  <a-upload
                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                    listType="picture-card"
                    :fileList="dpewmfileList"
                    @preview="handlePreview"
                    @change="dpewmChange"
                    accept=".jpg"
                  >
                    <div v-if="dpewmfileList.length < 1">
                      <a-icon type="plus" />
                      <div class="ant-upload-text">照片上传</div>
                    </div>
                  </a-upload>
                </div>
              </div>
            </li>
          </ul>
          <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
            <img alt="example" style="width: 100%" :src="previewImage" />
          </a-modal>
        </div>
      </div>
    </a-spin>

    <!-- <div class="shjj_box shjj_box2">
      
    </div>
    <div class="shjj_box shjj_box3">
      
    </div>-->
    <div class="sub_box">
      <a-button
        type="primary"
        :disabled="this.jjinpvaldata.applyment_state=='FINISH'?true:false"
        @click="subform"
        v-if="editfl!='ok'"
      >保存资料</a-button>
      <a-button
        type="primary"
        :disabled="this.jjinpvaldata.applyment_state=='FINISH'?true:false"
        @click="subjj"
        v-if="editfl=='ok'"
      >提交进件</a-button>
    </div>
  </div>
</template>

<script>
import qs from "qs";
import headerComm from "../header-comm/header.vue";
import { setTimeout } from "timers";
import { request } from "http";

export default {
  inject: ["reload"],
  data() {
    return {
      spinning: false,
      radioStyle: {
        display: "inline-block",
        height: "30px",
        lineHeight: "30px"
      },
      previewVisible: false,
      previewImage: "",
      jjkhlist: [],
      zjsmfileList: [], //证件照扫描
      sfzfileList: [], //身份证人像面照片上传
      zzjgfileList: [], //组织机构代码证照片上传
      sfzghfileList: [], //身份证国徽面照片上传：
      hzfileList: [], //护照----证件照片
      dpewmfileList: [], //店铺二维码
      thumbUrl: [],
      //   表单  v-model----开始
      jjid_num: "",
      jjkh_value: "请选择进件客户",
      qy_sqdwid: "",
      out_request_no: "", //业务申请编号
      organization_type: 2, //主体类型
      business_license_copy: [], //证件扫描件--pic
      business_license_number: "", //证件注册号
      merchant_name: "", //商户名称：
      legal_person: "", //经营者/法定代表人姓名

      organization_copy: "", //组织机构代码证照片：--pic
      organization_number: "", //组织机构代码：
      organization_time: "", //组织机构代码有效期
      id_doc_type: "IDENTIFICATION_TYPE_MAINLAND_IDCARD",

      id_doc_name: "", //证件姓名
      id_doc_number: "", //证件号码
      id_doc_copy: "", //证件照片
      doc_period_end: "", //证件结束日期
      //   ----id_card_info
      id_card_copy: [], //身份证人像面照片上传--pic
      id_card_national: [], //身份证国徽面照片上传：--pic
      id_card_name: "", //身份证姓名：
      id_card_number: "", //身份证号码：
      id_card_valid_time: "", //身份证有效期限：
      //   --- account_info
      account_bank: "", //开户银行：
      account_name: "", //开户名称：
      bank_address_code: "", //开户银行省市编码
      account_number: "", //银行帐号：
      bank_name: "", //开户银行全称
      //   -----contact_info
      contact_type: 65, //超级管理员类型：
      contact_name: "", //超级管理员姓名：
      contact_id_card_number: "", //超级管理员身份证件号码：
      mobile_phone: "", //超级管理员手机：
      mobile_email: "", //超级管理员邮箱：
      merchant_shortname: "", //商户简称：
      store_qr_code: [], //店铺二维码---pic
      //   表单  v-model----结束

      jjinpvaldata: "",
      editflag: true,
      editfl: "",
      subjjflg: true,
      dataSource: [
        "工商银行",
        "交通银行",
        "招商银行",
        "民生银行",
        "中信银行",
        "浦发银行",
        "兴业银行",
        "光大银行",
        "广发银行",
        "平安银行",
        "北京银行",
        "华夏银行",
        "农业银行",
        "建设银行",
        "邮政储蓄银行 ",
        "中国银行",
        "宁波银行"
      ]
    };
  },
  components: {
    headerComm
  },
  methods: {
    onChange(e) {
      console.log("radio checked", e.target.value);
    },
    handleCancel() {
      this.previewVisible = false;
    },
    handlePreview(file) {
      this.previewImage = file.url || file.thumbUrl;
      this.previewVisible = true;
    },
    zjChange(value) {
      console.log(`selected ${value}`);
      this.id_doc_type = value;
    },
    // 上传图片change--开始
    zjsmChange({ fileList }) {
      this.zjsmfileList = fileList;
      console.log(fileList);
    },
    zzjgChange({ fileList }) {
      this.zzjgfileList = fileList;
      console.log(fileList);
    },
    sfzChange({ fileList }) {
      this.sfzfileList = fileList;
      console.log(fileList);
    },
    sfzghChange({ fileList }) {
      this.sfzghfileList = fileList;
      console.log(fileList);
    },
    hzChange({ fileList }) {
      this.hzfileList = fileList;
      console.log(fileList);
    },
    dpewmChange({ fileList }) {
      this.dpewmfileList = fileList;
      console.log(fileList);
    },
    enddateChange(date, dateString) {
      console.log(date, dateString);
      this.doc_period_end = dateString;
    },
    // 上传图片change--结束
    // isCardNo(card) {
    //   // 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
    //   var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
    //   if (reg.test(card) === false) {
    //     alert("身份证输入不合法");
    //     return false;
    //   }
    //   return true;
    // },
    jjkhChange(value) {
      console.log(`selected ${value}`);
      this.jjkh_value = value;
    },
    getsqdwid(id) {
      this.qy_sqdwid = id;
      this.out_request_no = "APPLYMENT_" + this.qy_sqdwid;
    },
    khmcSearch(value) {
      this.getkhmc(value);
    },
    filterOption(input, option) {
      return (
        option.componentOptions.children[0].text
          .toUpperCase()
          .indexOf(input.toUpperCase()) >= 0
      );
    },
    handleBlur() {
      console.log("blur");
      if (this.qy_sqdwid == "" && this.jjkh_value != "") {
        for (var i = 0; i < this.jjkhlist.length; i++) {
          if (this.jjkh_value == this.jjkhlist[i].GSMC) {
            this.qy_sqdwid = this.jjkhlist[i].SQDWID;
          }
        }
        this.out_request_no = "APPLYMENT_" + this.qy_sqdwid;

        console.log(this.qy_sqdwid);
      }
      this.getkhmc();
    },
    handleFocus() {
      console.log("focus");
    },
    subform() {
      this.spinning = true;
      console.log("1--进件客户：", this.jjkh_value);
      console.log("2--业务申请编号：", this.out_request_no);
      console.log("3--主体类型：", this.organization_type);
      //-----上传照片处理-------------------------------------------------
      this.business_license_copy = "";
      if (this.zjsmfileList.length) {
        if (this.zjsmfileList[0].url) {
          this.business_license_copy = this.jjinpvaldata.business_license_copy;
        } else {
          this.business_license_copy = this.zjsmfileList[0].thumbUrl;
        }
      }
      console.log("4--证件扫描件--pic: ", this.business_license_copy);
      //--------上传照片处理----------------------------------------------

      //-----上传照片处理-------------------------------------------------
      this.organization_copy = "";
      if (this.zzjgfileList.length) {
        if (this.zzjgfileList[0].url) {
          this.organization_copy = this.jjinpvaldata.organization_copy;
        } else {
          this.organization_copy = this.zzjgfileList[0].thumbUrl;
        }
      }
      console.log("4--组织机构代码证照片：--pic: ", this.organization_copy);
      //--------上传照片处理----------------------------------------------
      console.log("5--组织机构代码：: ", this.organization_number);
      console.log("5--组织机构代码有效期: ", this.organization_time);

      console.log("5--证件注册号: ", this.business_license_number);
      console.log("6--商户名称: ", this.merchant_name);
      console.log("7--经营者/法定代表人姓名: ", this.legal_person);
      //-----上传照片处理-------------------------------------------------
      this.id_card_copy = "";
      if (this.sfzfileList.length) {
        if (this.sfzfileList[0].url) {
          this.id_card_copy = this.jjinpvaldata.id_card_copy;
        } else {
          this.id_card_copy = this.sfzfileList[0].thumbUrl;
        }
      }
      console.log("8--身份证人像面照片上传--pic: ", this.id_card_copy);
      //--------上传照片处理----------------------------------------------
      //-----上传照片处理-------------------------------------------------
      this.id_card_national = "";
      if (this.sfzghfileList.length) {
        if (this.sfzghfileList[0].url) {
          this.id_card_national = this.jjinpvaldata.id_card_national;
        } else {
          this.id_card_national = this.sfzghfileList[0].thumbUrl;
        }
      }
      console.log("9--身份证人像面照片上传--pic: ", this.id_card_national);
      //--------上传照片处理----------------------------------------------
      console.log("10--身份证姓名: ", this.id_card_name);
      console.log("11--身份证号码: ", this.id_card_number);
      console.log("12--身份证有效期限：", this.id_card_valid_time);

      console.log("11--证件姓名: ", this.id_doc_name);
      console.log("11--证件号码: ", this.id_doc_number);
      console.log("11--证件结束日期: ", this.doc_period_end);

      console.log("13--开户银行：", this.account_bank);
      console.log("14--开户名称：", this.account_name);
      console.log("15--开户银行省市编码：", this.bank_address_code);
      console.log("16--银行帐号：", this.account_number);
      console.log("17--超级管理员类型：", this.contact_type);
      console.log("18--超级管理员姓名：", this.contact_name);
      console.log("19--超级管理员身份证件号码：", this.contact_id_card_number);
      console.log("20--超级管理员手机：", this.mobile_phone);
      console.log("21--超级管理员邮箱：", this.mobile_email);
      console.log("22--商户简称：", this.merchant_shortname);
      //-----上传照片处理-------------------------------------------------
      this.store_qr_code = "";
      if (this.dpewmfileList.length) {
        if (this.dpewmfileList[0].url) {
          this.store_qr_code = this.jjinpvaldata.store_qr_code;
        } else {
          this.store_qr_code = this.dpewmfileList[0].thumbUrl;
        }
      }
      console.log("23--店铺二维码--pic：", this.store_qr_code);
      //--------上传照片处理----------------------------------------------
      //-----上传照片处理-------------------------------------------------
      this.id_doc_copy = "";
      if (this.hzfileList.length) {
        if (this.hzfileList[0].url) {
          this.id_doc_copy = this.jjinpvaldata.id_doc_copy;
        } else {
          this.id_doc_copy = this.hzfileList[0].thumbUrl;
        }
      }
      console.log("24--护照--证件照--pic：", this.id_doc_copy);
      //--------上传照片处理----------------------------------------------

      var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
      console.log("-----------------------------", this.id_doc_type);
      if (this.id_doc_type == "IDENTIFICATION_TYPE_MAINLAND_IDCARD") {
        if (reg.test(this.id_card_number) === false) {
          // alert("身份证输入不合法");
          this.$notification["error"]({
            message: "失败",
            description: "身份证输入不合法"
          });
          this.spinning = false;

          return false;
        }
      }

      if (reg.test(this.contact_id_card_number) === false) {
        // alert("超级管理员身份证输入不合法");
        this.$notification["error"]({
          message: "失败",
          description: "超级管理员身份证输入不合法"
        });
        this.spinning = false;

        return false;
      }
      this.axios
        .post(
          "wxpay/AddSubUserInfo.php",
          qs.stringify({
            id_num: this.jjid_num,
            sqdwid: this.qy_sqdwid,
            dwmc: this.jjkh_value,
            out_request_no: this.out_request_no,
            business_license_copy: this.business_license_copy,
            organization_type: this.organization_type,
            business_license_number: this.business_license_number,

            organization_copy: this.organization_copy,
            organization_number: this.organization_number,
            organization_time: this.organization_time,

            merchant_name: this.merchant_name,
            legal_person: this.legal_person,
            id_card_copy: this.id_card_copy,
            id_card_national: this.id_card_national,
            id_card_name: this.id_card_name,
            id_card_number: this.id_card_number,
            id_card_valid_time: this.id_card_valid_time,

            id_doc_type: this.id_doc_type,
            id_doc_name: this.id_doc_name,
            id_doc_number: this.id_doc_number,
            id_doc_copy: this.id_doc_copy,
            doc_period_end: this.doc_period_end,

            account_bank: this.account_bank,
            account_name: this.account_name,
            bank_address_code: this.bank_address_code,
            account_number: this.account_number,
            bank_name: this.bank_name,
            contact_type: this.contact_type,
            contact_name: this.contact_name,

            contact_id_card_number: this.contact_id_card_number,
            mobile_phone: this.mobile_phone,
            contact_email: this.mobile_email,
            merchant_shortname: this.merchant_shortname,
            store_qr_code: this.store_qr_code
          }),
          {
            headers: {
              sqdwid: this.$store.state.bbl_sqdwid
            }
          }
        )
        .then(res => {
          console.log(res);
          if (res.data.code == 303) {
            console.log(this.jjid_num);
            if (this.jjid_num == "") {
              this.$notification["success"]({
                message: "成功",
                description: res.data.msg
              });
              location.href = "/sublist";
              this.spinning = false;
            }
          } else {
            this.$notification["error"]({
              message: "失败",
              description: res.data.msg
            });
            this.subjjflg = false;
            this.spinning = false;
          }
        });
    },
    //进件资料
    subjj() {
      if (this.subjjflg) {
        this.subform();
        this.axios
          .post(
            "https://xh.bearing.cn/api/wxpay/getMerchantEntry.php",
            qs.stringify({
              sqdwid: this.jjinpvaldata.sqdwid
            })
          )
          .then(res => {
            console.log(res);
            if (res.data.code == 303) {
              const modal = this.$success({
                title: "成功",
                content: res.data.result.message
              });
              modal.update({
                content: res.data.result.message
              });
              this.spinning = false;
            } else {
              const modal = this.$error({
                title: "失败",
                content: res.data.result.message
              });
              modal.update({
                content: res.data.result.message
              });
              this.spinning = false;
            }
          });
      } else {
        this.subform();
      }
    },
    //客户名称
    getkhmc(value) {
      // this.axios.defaults.headers.common['hjjjjjjj'] = "!1111111111111111"
      this.axios
        .post("yangben/SelectYbGsmc.php", qs.stringify({ gsmc: value }))
        .then(res => {
          console.log(res);
          if (res.data.code == 303) {
            this.jjkhlist = res.data.result;
          } else if (res.data.result == null) {
            this.jjkhlist = [];
          }
        });
    },
    getkhyh(){
      console.log(this.account_bank)
    }
  },

  created() {
    this.getkhmc();
    var dataObj = this.$route.query.edit;
    this.editfl = this.$route.query.edit;
    console.log(dataObj);

    if (dataObj == "ok") {
      this.editflag = true;
      this.jjinpvaldata = JSON.parse(sessionStorage.getItem("editvalue")); //修改拿过来的数据

      this.jjid_num = this.jjinpvaldata.id_num;
      this.qy_sqdwid = this.jjinpvaldata.sqdwid;
      this.jjkh_value = this.jjinpvaldata.dwmc;
      this.out_request_no = this.jjinpvaldata.out_request_no;

      this.organization_type = Number(this.jjinpvaldata.organization_type);

      // this.business_license_copy=this.jjinpvaldata.business_license_copy//-----
      if (this.jjinpvaldata.business_license_copy.trim() != "") {
        let list = {
          uid: " ",
          name: " ",
          status: " ",
          url:
            "https://vip.bearing.cn/wxpay/upload/" +
            this.jjinpvaldata.business_license_copy
        };
        this.zjsmfileList.push(list);
      }
      this.business_license_number = this.jjinpvaldata.business_license_number;
      this.merchant_name = this.jjinpvaldata.merchant_name;
      this.legal_person = this.jjinpvaldata.legal_person;
      // this.id_card_copy=this.jjinpvaldata.id_card_copy//-----------
      if (this.jjinpvaldata.id_card_copy.trim() != "") {
        let list = {
          uid: " ",
          name: " ",
          status: " ",
          url:
            "https://vip.bearing.cn/wxpay/upload/" +
            this.jjinpvaldata.id_card_copy
        };
        this.sfzfileList.push(list);
      }
      console.log(this.jjinpvaldata.organization_copy);
      if (this.jjinpvaldata.organization_copy.trim() != "") {
        let list = {
          uid: " ",
          name: " ",
          status: " ",
          url:
            "https://vip.bearing.cn/wxpay/upload/" +
            this.jjinpvaldata.organization_copy
        };
        this.zzjgfileList.push(list);
      }

      // this.id_card_national=this.jjinpvaldata.id_card_national//---------
      if (this.jjinpvaldata.id_card_national.trim() != "") {
        let list = {
          uid: " ",
          name: " ",
          status: " ",
          url:
            "https://vip.bearing.cn/wxpay/upload/" +
            this.jjinpvaldata.id_card_national
        };
        this.sfzghfileList.push(list);
      }
      this.id_card_name = this.jjinpvaldata.id_card_name;
      this.id_card_number = this.jjinpvaldata.id_card_number;
      this.id_card_valid_time = this.jjinpvaldata.id_card_valid_time;

      // this.id_doc_copy = this.jjinpvaldata.id_doc_copy;//--护照照片
      if (this.jjinpvaldata.id_doc_copy.trim() != "") {
        let list = {
          uid: " ",
          name: " ",
          status: " ",
          url:
            "https://vip.bearing.cn/wxpay/upload/" +
            this.jjinpvaldata.id_doc_copy
        };
        this.hzfileList.push(list);
      }

      this.id_doc_type = this.jjinpvaldata.id_doc_type; //--法人类型
      this.id_doc_name = this.jjinpvaldata.id_doc_name; //--证件姓名
      this.id_doc_number = this.jjinpvaldata.id_doc_number; //--证件号码
      this.doc_period_end = this.jjinpvaldata.doc_period_end; //--证件结束日期

      this.account_bank = this.jjinpvaldata.account_bank;
      this.account_name = this.jjinpvaldata.account_name;
      this.bank_address_code = this.jjinpvaldata.bank_address_code;

      this.bank_name = this.jjinpvaldata.bank_name;
      this.account_number = this.jjinpvaldata.account_number;
      this.contact_type = Number(this.jjinpvaldata.contact_type);
      this.contact_name = this.jjinpvaldata.contact_name;
      this.contact_id_card_number = this.jjinpvaldata.contact_id_card_number;
      this.mobile_phone = this.jjinpvaldata.mobile_phone;
      this.mobile_email = this.jjinpvaldata.contact_email;
      this.merchant_shortname = this.jjinpvaldata.merchant_shortname;
      this.organization_number = this.jjinpvaldata.organization_number;
      this.organization_time = this.jjinpvaldata.organization_time;
      // this.store_qr_code=this.jjinpvaldata.store_qr_code//--------
      if (this.jjinpvaldata.store_qr_code.trim() != "") {
        let list = {
          uid: " ",
          name: " ",
          status: " ",
          url:
            "https://vip.bearing.cn/wxpay/upload/" +
            this.jjinpvaldata.store_qr_code
        };
        this.dpewmfileList.push(list);
      }

      console.log("okkkkkkkkkkk");
    } else {
      this.editflag = false;
      sessionStorage.removeItem("editvalue");
    }
    console.log(this.jjinpvaldata);
  }
};
</script>

<style lang='less' >
.hedlist {
  position: relative;
  top: 65px;
  width: 98%;
  left: 1%;
  height: 60px;
  background-color: #fff;
  text-align: left;
  padding: 15px;
  display: flex;
  justify-content: space-between;
}
.shjj_box {
  background: #fff;
  width: 98%;
  display: inline-block;
  //   margin: 0 auto;
  position: relative;
  top: 70px;
  text-align: left;
  padding: 20px;
  vertical-align: top;
  .shjj_form {
    width: 100%;
    display: inline-block;
    vertical-align: top;
    .red_tit {
      color: red;
      font-size: 14px;
    }
    ul {
      li {
        margin: 15px 0;
        position: relative;
        .bz_box {
          position: absolute;
          left: 48%;
          width: 48%;
          .khyh {
            position: relative;
            top: 160px;
            color: #999;
            z-index: 9;
          }
          .zs_tit {
            //   display: inline-block;
          }
        }
        .sqdow {
          bottom: -100px;
        }
        .ztlx_box {
          top: -6px;
        }
        .yyzz_box {
          top: 80px;
        }
        .yq_tit {
          top: -84px;
        }
        .cjgly {
          top: 35px;
        }
        .dpxx {
          top: 40px;
        }
        .inp_tit {
          display: inline-block;
          width: 16%;
          text-align: right;
        }
        input {
          width: 300px;
        }
        .upload_tit {
          margin: 40px 30px 10px;
          font-size: 16px;
          color: #666;
          font-weight: bold;
        }

        .zs_tit {
          font-size: 13px;
          color: #999;
          margin: 0;
        }
        .yq_tit {
          //   margin: 10px 89px 0;
          color: #999;
          p {
            margin: 0;
            font-size: 13px;
          }
        }
        .up_pic {
          margin-top: 20px;
          .clearfix {
            // margin-left: 80px;
            display: inline-block;
            vertical-align: middle;
            width: 74%;
          }
          .ant-upload.ant-upload-select-picture-card {
            width: 104px !important;
            height: 104px !important;
            border: 1px solid #ccc !important;
          }
        }
      }
    }
  }
}

.sub_box {
  width: 98%;
  margin-top: 50px;
  background: #fff;
  padding: 70px 0;
  margin: 0 auto;
  text-align: left;
  button {
    height: 40px;
    width: 140px;
    margin-left: 13%;
  }
}
.ant-select-auto-complete.ant-select .ant-select-search--inline{
  margin: 0;
}
</style>
